package asruby.yarv
{
import asruby.runtime.CallSite;
import asruby.runtime.IRubyObject;
	
public class Instruction
{
   	public var bytecode: int;
    public var line_no: int;
    public var s_op0: String;
    public var o_op0: IRubyObject;
    public var _tmp: Object;
    public var l_op0: Number;
    public var l_op1: Number;
    public var i_op1: int;
    public var iseq_op: InstructionSequence;
    public var ins_op: Array;
    public var i_op3: int;

    public var index: int;
    public var methodIndex:int = -1;
    public var callAdapter: CallSite;
	
	public var body:Array;
	
    public function Instruction(bytecode: int, op: String=null, op1: int=0, op2: Array=null, op3: int=0) {
        this.bytecode = bytecode;
        this.s_op0 = op;
        this.i_op1 = op1;
        this.ins_op = op2;
        this.i_op3 = op3;
    }

    public function toString(): String {
        return "[:" + YARVInstructions.name(bytecode) + ", " + 
            (s_op0 != null ? s_op0 : (o_op0 != null ? o_op0.toString() : ("" + l_op0))) + "]";
    }
}
}